<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // 水仙花数 
        for (var i = 100; i < 1000 ; i++) {
            var ge = i % 10;
            var shi = Math.floor((i % 100) / 10);
            var bai = Math.floor(i % 100) ;
            if (Math.pow(ge,3) + Math.pow(shi,3) + Math.pow(bai,3) == i) {
                console.log(i);
            }
        }


        // 有点帅了

        for (var i = 1; i < 10; i++) {
            for (var j = 0; j < 10; j++) {
                for (var m = 0; m < 10; m++) {
                    var num = i * 100 + j * 10 + m;
                    if (i * i * i + j * j * j + m * m * m == num) {
                        console.log(num)
                    }
                }
            }
        }

    </script>

</body>

</html>